package com.aspose.cells.a.d;

import com.aspose.cells.Color;
import java.awt.Font;
import java.awt.GradientPaint;
import java.awt.Graphics2D;
import java.awt.Polygon;
import java.awt.RenderingHints.Key;
import java.awt.font.TextAttribute;
import java.awt.geom.AffineTransform;
import java.awt.geom.Area;
import java.awt.geom.GeneralPath;
import java.awt.geom.Rectangle2D;
import java.awt.geom.CubicCurve2D.Float;
import java.awt.geom.Point2D.Double;
import java.awt.image.BufferedImage;
import java.awt.image.ImageObserver;
import java.io.ByteArrayInputStream;
import java.text.AttributedString;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Stack;
import java.util.Map.Entry;
import javax.imageio.ImageIO;

public class zat extends ze {
   private Graphics2D g;
   private Stack h = new Stack();
   private GeneralPath i;
   private static float[] j = new float[0];
   private static float[] k = new float[]{3.0F, 1.0F};
   private static float[] l = new float[]{1.0F, 1.0F};
   private static float[] m = new float[]{3.0F, 1.0F, 1.0F, 1.0F};
   private static float[] n = new float[]{3.0F, 1.0F, 1.0F, 1.0F, 1.0F, 1.0F};
   private static String o = "[\\u0590-\\u05FF]+";

   public void a(zl var1, Graphics2D var2) throws Exception {
      if (var1 == null) {
         throw new Exception("ArgumentNull node");
      } else if (var2 == null) {
         throw new Exception("ArgumentNull graphics");
      } else {
         this.g = var2;
         var1.a((ze)this);
      }
   }

   public void a(zl var1, com.aspose.cells.b.a.b.zi var2) throws Exception {
      AffineTransform var3 = a(var2.b(), 0.0F, 0.0F);
      this.a(var1, var2.b(), var3);
   }

   public void b(zl var1, Graphics2D var2) throws Exception {
      AffineTransform var3 = a(var2, 0.0F, 0.0F);
      this.a(var1, var2, var3);
   }

   public com.aspose.cells.b.a.b.zt a(zm var1, Graphics2D var2, float var3, float var4, float var5) throws Exception {
      return this.a(var1, var2, var3, var4, var5, var5);
   }

   public com.aspose.cells.b.a.b.zt a(zm var1, Graphics2D var2, float var3, float var4, float var5, float var6) throws Exception {
      if (var1 == null) {
         throw new Exception("page ArgumentNull");
      } else if (var2 == null) {
         throw new Exception("graphics ArgumentNull");
      } else if (var5 > 0.0F && var6 > 0.0F) {
         AffineTransform var7 = a(var2, var3, var4);
         var7.scale((double)var5, (double)var6);
         this.a(var1, var2, var7);
         com.aspose.cells.b.a.b.zo var8 = b(new com.aspose.cells.b.a.b.zo(var1.b(), var1.c()), var2);
         return new com.aspose.cells.b.a.b.zt(var8.d() * var5, var8.e() * var6);
      } else {
         throw new Exception("ArgumentOutOfRange scale");
      }
   }

   private static AffineTransform a(Graphics2D var0, float var1, float var2) {
      AffineTransform var3 = var0.getTransform();
      com.aspose.cells.b.a.b.zo var4 = a(new com.aspose.cells.b.a.b.zo(var3.getTranslateX(), var3.getTranslateY()), var0);
      double[] var5 = new double[6];
      var3.getMatrix(var5);
      AffineTransform var6 = new AffineTransform(var5[0], var5[1], var5[2], var5[3], (double)var4.d(), (double)var4.e());
      com.aspose.cells.b.a.b.zo var7 = a(new com.aspose.cells.b.a.b.zo(var1, var2), var0);
      var6.translate((double)var7.d(), (double)var7.e());
      return var6;
   }

   private void a(zl var1, Graphics2D var2, AffineTransform var3) throws Exception {
      AffineTransform var4 = var2.getTransform();
      var2.setTransform(var3);
      this.a(var1, var2);
   }

   private static com.aspose.cells.b.a.b.zo a(com.aspose.cells.b.a.b.zo var0, Graphics2D var1) {
      return new com.aspose.cells.b.a.b.zo(var0.d(), var0.e());
   }

   private static com.aspose.cells.b.a.b.zo b(com.aspose.cells.b.a.b.zo var0, Graphics2D var1) {
      return new com.aspose.cells.b.a.b.zo(var0.d(), var0.e());
   }

   public void a(zf var1) {
      this.a((zbg)var1);
      if (com.aspose.cells.b.a.g.a.ze.b(var1.h(), o, 66)) {
         String var2 = var1.h();
         char[] var3 = var2.toCharArray();
         var2 = "";
         com.aspose.cells.b.a.za.a(var3);
         char[] var4 = var3;
         int var5 = var3.length;

         for(int var6 = 0; var6 < var5; ++var6) {
            char var7 = var4[var6];
            var2 = var2 + var7;
         }

         var1.a(var2);
      }

      HashMap var14 = new HashMap();
      HashMap var15 = new HashMap();
      if (var1.d().g()) {
         var14.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
         var15.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
      }

      if (var1.d().f()) {
         var14.put(TextAttribute.STRIKETHROUGH, TextAttribute.STRIKETHROUGH_ON);
      }

      if (var1.b) {
         var15.put(TextAttribute.SUPERSCRIPT, TextAttribute.SUPERSCRIPT_SUB);
      }

      if (var1.a) {
         var15.put(TextAttribute.SUPERSCRIPT, TextAttribute.SUPERSCRIPT_SUPER);
      }

      Font var16 = var1.d().k().a().deriveFont(var15);
      if (!var1.e().isEmpty()) {
         float var17 = this.a(var1.g().d());
         float var18 = this.a(var1.g().e());
         this.g.translate((double)var17, (double)var18);
         float var19 = var1.n();
         if (var19 != 0.0F) {
            this.g.scale((double)var19, 1.0D);
         }

         String var8 = var1.h();
         var8 = var8.replace("\r", "");
         var8 = var8.replace("\n", "");
         if (var16.getName().equals("Wingdings") || var16.getName().equals("Symbol")) {
            char[] var9 = var8.toCharArray();
            var8 = "";
            char[] var10 = var9;
            int var11 = var9.length;

            for(int var12 = 0; var12 < var11; ++var12) {
               char var13 = var10[var12];
               var8 = var8 + (char)(var13 + '\uf000');
            }
         }

         if (var14.size() <= 0) {
            this.g.setPaint(var1.e().d());
            this.g.setFont(var16);
            this.g.drawString(var8, 0, 0);
         } else {
            AttributedString var20 = new AttributedString(var8);
            var20.addAttribute(TextAttribute.FONT, var16);
            Iterator var21 = var14.entrySet().iterator();

            while(var21.hasNext()) {
               Entry var22 = (Entry)var21.next();
               var20.addAttribute((TextAttribute)var22.getKey(), var22.getValue());
            }

            this.g.setPaint(var1.e().d());
            this.g.drawString(var20.getIterator(), 0, 0);
         }

         if (var19 != 0.0F) {
            this.g.scale(1.0D / (double)var19, 1.0D);
         }

         this.g.translate((double)(-var17), (double)(-var18));
      }

      this.b((zbg)var1);
   }

   public void a(zb var1) {
      this.a((zbg)var1);
      if (var1.b() != null) {
         AffineTransform var2 = this.g.getTransform();
         this.a(this.g, var1.b());
         this.g.setTransform(var2);
      }

      if (zaz.e(var1)) {
         this.a(var1.f());
      }

   }

   public void b(zb var1) {
      this.b((zbg)var1);
   }

   public void a(zn var1) {
      this.a((zbg)var1);
      this.i = new GeneralPath(this.a(var1.e()));
   }

   public void b(zn var1) {
      com.aspose.cells.b.a.b.zc var2 = var1.d();
      zs var3 = var1.a;
      if (var2 != null) {
         if (var2 instanceof com.aspose.cells.b.a.b.a.zh) {
            this.g.setClip(this.i);
            this.a((com.aspose.cells.b.a.b.a.zh)var2, this.g);
         } else if (var2 instanceof com.aspose.cells.b.a.b.a.zk) {
            com.aspose.cells.b.a.b.a.zk var4 = (com.aspose.cells.b.a.b.a.zk)var2;
            this.g.setClip(this.i);
            if (var4.a() == 1) {
               this.a(var4, this.g);
            } else if (var4.a() == 2) {
               this.b(var4, this.g);
            } else {
               this.a(var4, this.g);
            }
         } else if (var2 instanceof com.aspose.cells.b.a.b.zx) {
            this.g.setClip(this.i);
            com.aspose.cells.b.a.b.zx var12 = (com.aspose.cells.b.a.b.zx)var2;
            this.a(var12, this.g);
         } else if (var2 instanceof com.aspose.cells.b.a.b.a.zg) {
            double var13 = this.g.getTransform().getScaleX();
            double var6 = this.g.getTransform().getScaleX();
            if (var13 == 1.0D && var6 == 1.0D) {
               this.g.setPaint(var2.g());
               this.g.fill(this.i);
            } else {
               com.aspose.cells.b.a.b.a.zg var8 = (com.aspose.cells.b.a.b.a.zg)var2;
               Graphics2D var9 = (Graphics2D)this.g.create();
               var9.scale(1.0D / var13, 1.0D / var6);
               GeneralPath var10 = (GeneralPath)this.i.clone();
               AffineTransform var11 = new AffineTransform();
               var11.scale(var13, var6);
               var10.transform(var11);
               var9.setPaint(var8.g());
               var9.fill(var10);
            }
         } else {
            this.g.setPaint(var2.g());
            this.g.fill(this.i);
         }
      }

      if (var3 != null) {
         if (var3.i == 0) {
            this.g.setColor(var3.a.d());
         } else if (var3.j != null) {
            this.g.setPaint(var3.j.g());
         }

         this.g.setStroke(zs.a(var1.a).s());
         this.g.draw(this.i);
      }

      this.b((zbg)var1);
      this.i = null;
   }

   private void a(com.aspose.cells.b.a.b.a.zh var1, Graphics2D var2) {
      com.aspose.cells.b.a.b.a.zc var3 = var1.m();
      if (var3 == null) {
         var2.setPaint(var1.g());
         var2.fill(this.i);
      } else {
         com.aspose.cells.b.a.b.zq var4 = var1.o();
         double var5 = var1.b().doubleValue();
         Double var7 = new Double((double)(var4.f() + var4.h() / 2.0F), (double)(var4.g() + var4.i() / 2.0F));
         double var8 = (double)var4.h() * Math.abs(Math.cos(var5 * 3.141592653589793D / 180.0D)) + (double)var4.i() * Math.abs(Math.sin(var5 * 3.141592653589793D / 180.0D));
         double var10 = (double)var4.i() * Math.abs(Math.cos(var5 * 3.141592653589793D / 180.0D)) + (double)var4.h() * Math.abs(Math.sin(var5 * 3.141592653589793D / 180.0D));
         java.awt.geom.Rectangle2D.Double var12 = new java.awt.geom.Rectangle2D.Double(var7.getX() - var8 / 2.0D, var7.getY() - var10 / 2.0D, var8, var10);
         com.aspose.cells.b.a.b.a.zi var13 = new com.aspose.cells.b.a.b.a.zi();
         var13.a((float)var5, new com.aspose.cells.b.a.b.zo(var7.getX(), var7.getY()));
         double var14 = var12.getX();
         Color[] var16 = var3.b();
         float[] var17 = var3.a();

         for(int var18 = 1; var18 < var3.b().length; ++var18) {
            double var19 = var12.getWidth() * (double)(var17[var18] - var17[var18 - 1]);
            double var21 = var19;
            if (var18 != var3.b().length - 1) {
               var21 = var19 + 1.0D;
            }

            java.awt.geom.Rectangle2D.Double var23 = new java.awt.geom.Rectangle2D.Double(var14, var12.getY(), var21, var10);
            com.aspose.cells.b.a.b.zo[] var24 = new com.aspose.cells.b.a.b.zo[]{new com.aspose.cells.b.a.b.zo(var23.getX(), var23.getY()), new com.aspose.cells.b.a.b.zo(var23.getX(), var23.getY() + var23.getHeight()), new com.aspose.cells.b.a.b.zo(var23.getX() + var23.getWidth(), var23.getY() + var23.getHeight()), new com.aspose.cells.b.a.b.zo(var23.getX() + var23.getWidth(), var23.getY()), new com.aspose.cells.b.a.b.zo(var23.getX(), var7.getY()), new com.aspose.cells.b.a.b.zo(var23.getX() + var23.getWidth(), var7.getY())};
            var13.a(var24);
            Polygon var25 = new Polygon();
            var25.addPoint((int)var24[0].d(), (int)var24[0].e());
            var25.addPoint((int)var24[1].d(), (int)var24[1].e());
            var25.addPoint((int)var24[2].d(), (int)var24[2].e());
            var25.addPoint((int)var24[3].d(), (int)var24[3].e());
            GradientPaint var26 = new GradientPaint(var24[4].d(), var24[4].e(), var16[var18 - 1].d(), var24[5].d(), var24[5].e(), var16[var18].d(), false);
            var2.setPaint(var26);
            var2.fill(var25);
            var14 += var19;
         }
      }

   }

   private void a(com.aspose.cells.b.a.b.a.zk var1, Graphics2D var2) {
      com.aspose.cells.b.a.b.a.zc var3 = var1.c();
      if (var3 == null) {
         var2.setPaint(var1.g());
         var2.fill(this.i);
      } else {
         Rectangle2D var4 = var1.d();
         java.awt.geom.Rectangle2D.Double var5 = new java.awt.geom.Rectangle2D.Double(var4.getX(), var4.getY(), var4.getWidth() / 2.0D, var4.getHeight());
         this.a(var2, var3, var5, true);
         java.awt.geom.Rectangle2D.Double var6 = new java.awt.geom.Rectangle2D.Double(var4.getCenterX(), var4.getY(), var4.getWidth() / 2.0D, var4.getHeight());
         this.a(var2, var3, var6, false);
         java.awt.geom.Rectangle2D.Double var7 = new java.awt.geom.Rectangle2D.Double(var4.getX(), var4.getY(), var4.getWidth(), var4.getHeight() / 2.0D);
         this.b(var2, var3, var7, true);
         java.awt.geom.Rectangle2D.Double var8 = new java.awt.geom.Rectangle2D.Double(var4.getX(), var4.getCenterY(), var4.getWidth(), var4.getHeight() / 2.0D);
         this.b(var2, var3, var8, false);
      }

   }

   private void a(Graphics2D var1, com.aspose.cells.b.a.b.a.zc var2, Rectangle2D var3, boolean var4) {
      double var5 = var3.getX();
      Double var7 = null;
      Double var8 = null;
      Double var9 = null;
      Double var10 = null;
      boolean var11 = false;
      if (var4) {
         var7 = new Double(var3.getX(), var3.getY());
         var8 = new Double(var3.getX(), var3.getY() + var3.getHeight());
      } else {
         var11 = true;
         var7 = new Double(var3.getX(), var3.getCenterY());
         var8 = new Double(var3.getX(), var3.getCenterY());
      }

      int var12 = var2.b().length;
      Color[] var13 = new Color[var12];
      float[] var14 = new float[var12];

      int var15;
      for(var15 = 0; var15 < var12; ++var15) {
         int var16 = var15;
         if (var11) {
            var16 = var12 - 1 - var15;
         }

         var13[var15] = var2.b()[var16];
         float var17 = var2.a()[var16];
         var14[var15] = var11 ? 1.0F - var17 : var17;
      }

      for(var15 = 1; var15 < var13.length; ++var15) {
         double var25 = var3.getWidth() * (double)Math.abs(var14[var15] - var14[var15 - 1]);
         double var18 = var3.getHeight() * (double)var14[var15];
         if (var4) {
            var18 = var3.getHeight() * (double)(1.0F - var14[var15]);
         }

         var9 = new Double(var5 + var25, var3.getCenterY() + var18 / 2.0D);
         var10 = new Double(var5 + var25, var3.getCenterY() - var18 / 2.0D);
         double var20 = var25;
         if (var15 != var2.b().length - 1) {
            var20 = var25 + 1.0D;
         }

         java.awt.geom.Rectangle2D.Double var22 = new java.awt.geom.Rectangle2D.Double(var5, var3.getY(), var20, var3.getHeight());
         GradientPaint var23 = new GradientPaint((float)var22.getX(), (float)var3.getCenterY(), var13[var15 - 1].d(), (float)(var22.getX() + var22.getWidth()), (float)var3.getCenterY(), var13[var15].d(), false);
         var1.setPaint(var23);
         Polygon var24 = new Polygon();
         var24.addPoint((int)var7.getX(), (int)var7.getY());
         var24.addPoint((int)var8.getX(), (int)var8.getY());
         var24.addPoint((int)var9.getX(), (int)var9.getY());
         var24.addPoint((int)var10.getX(), (int)var10.getY());
         var1.fill(var24);
         var5 += var25;
         var7 = new Double(var10.getX(), var10.getY());
         var8 = new Double(var9.getX(), var9.getY());
      }

   }

   private void b(Graphics2D var1, com.aspose.cells.b.a.b.a.zc var2, Rectangle2D var3, boolean var4) {
      double var5 = var3.getY();
      Double var7 = null;
      Double var8 = null;
      Double var9 = null;
      Double var10 = null;
      boolean var11 = false;
      if (var4) {
         var7 = new Double(var3.getX() + var3.getWidth(), var3.getY());
         var8 = new Double(var3.getX(), var3.getY());
      } else {
         var11 = true;
         var7 = new Double(var3.getCenterX(), var3.getY());
         var8 = new Double(var3.getCenterX(), var3.getY());
      }

      int var12 = var2.b().length;
      Color[] var13 = new Color[var12];
      float[] var14 = new float[var12];

      int var15;
      for(var15 = 0; var15 < var12; ++var15) {
         int var16 = var15;
         if (var11) {
            var16 = var12 - 1 - var15;
         }

         var13[var15] = var2.b()[var16];
         float var17 = var2.a()[var16];
         var14[var15] = var11 ? 1.0F - var17 : var17;
      }

      for(var15 = 1; var15 < var13.length; ++var15) {
         double var25 = var3.getHeight() * (double)Math.abs(var14[var15] - var14[var15 - 1]);
         double var18 = var3.getWidth() * (double)var14[var15];
         if (var4) {
            var18 = var3.getWidth() * (double)(1.0F - var14[var15]);
         }

         var9 = new Double(var3.getCenterX() - var18 / 2.0D, var5 + var25);
         var10 = new Double(var3.getCenterX() + var18 / 2.0D, var5 + var25);
         double var20 = var25;
         if (var15 != var2.b().length - 1) {
            var20 = var25 + 1.0D;
         }

         java.awt.geom.Rectangle2D.Double var22 = new java.awt.geom.Rectangle2D.Double(var3.getX(), var5, var3.getWidth(), var20);
         GradientPaint var23 = new GradientPaint((float)var3.getCenterX(), (float)var22.getY(), var13[var15 - 1].d(), (float)var3.getCenterX(), (float)(var22.getY() + var22.getHeight()), var13[var15].d(), false);
         var1.setPaint(var23);
         Polygon var24 = new Polygon();
         var24.addPoint((int)var7.getX(), (int)var7.getY());
         var24.addPoint((int)var8.getX(), (int)var8.getY());
         var24.addPoint((int)var9.getX(), (int)var9.getY());
         var24.addPoint((int)var10.getX(), (int)var10.getY());
         var1.fill(var24);
         var5 += var25;
         var7 = new Double(var10.getX(), var10.getY());
         var8 = new Double(var9.getX(), var9.getY());
      }

   }

   private void b(com.aspose.cells.b.a.b.a.zk var1, Graphics2D var2) {
      com.aspose.cells.b.a.b.a.zc var3 = var1.c();
      if (var3 == null) {
         var2.setPaint(var1.g());
         var2.fill(this.i);
      } else {
         Rectangle2D var4 = var1.d();
         int var5 = var3.b().length;
         java.awt.Color[] var6 = new java.awt.Color[var5];
         float[] var7 = new float[var5];
         boolean var8 = true;

         for(int var9 = 0; var9 < var5; ++var9) {
            int var10 = var9;
            if (var8) {
               var10 = var5 - 1 - var9;
            }

            var6[var9] = var3.b()[var10].d();
            float var11 = var3.a()[var10];
            var7[var9] = var8 ? 1.0F - var11 : var11;
         }

         Double var12 = new Double(var4.getCenterX(), var4.getCenterY());
         com.aspose.cells.a.d.b.za.a(var2, this.i, var12, (float)var4.getWidth() / 2.0F, var7, var6);
      }

   }

   private void a(com.aspose.cells.b.a.b.zx var1, Graphics2D var2) {
      com.aspose.cells.b.a.b.zj var3 = var1.a();
      com.aspose.cells.b.a.b.zq var4 = var1.d();
      if (var3 instanceof com.aspose.cells.b.a.b.za) {
         BufferedImage var5 = var3.f();
         int var6 = (int)var4.f();
         int var7 = (int)var4.g();
         int var8 = (int)var4.l();
         int var9 = (int)var4.m();
         byte var10 = 0;
         byte var11 = 0;
         int var12 = var3.i();
         int var13 = var3.h();
         var2.drawImage(var5, var6, var7, var8, var9, var10, var11, var12, var13, (ImageObserver)null);
      } else if (var3 instanceof com.aspose.cells.b.a.b.b.zf) {
         com.aspose.cells.b.a.b.zo var15 = new com.aspose.cells.b.a.b.zo(this.b(var4.f()), this.b(var4.g()));
         com.aspose.cells.b.a.b.zt var16 = new com.aspose.cells.b.a.b.zt(this.b(var4.h()), this.b(var4.i()));
         zj var17 = new zj(var15, var16, var3.f);

         try {
            zb var18 = zch.a(var17);
            var18.a((ze)this);
         } catch (Exception var14) {
            var14.printStackTrace();
         }
      }

   }

   public void a(zo var1) {
      if (var1 != null) {
         this.i.moveTo(this.a(var1.a().d()), this.a(var1.a().e()));
      }
   }

   public void b(zo var1) {
      if (var1.b()) {
         this.i.closePath();
      }

   }

   public void a(zq var1) {
      for(int var2 = 0; var2 < var1.a().size(); ++var2) {
         com.aspose.cells.b.a.b.zo var3 = (com.aspose.cells.b.a.b.zo)var1.a().get(var2);
         this.i.lineTo(this.a(var3.d()), this.a(var3.e()));
      }

   }

   public void a(zp var1) {
      ArrayList var2 = var1.a();
      if (var2 != null) {
         for(int var3 = 0; var3 < var2.size(); ++var3) {
            zt var4 = (zt)var2.get(var3);
            Float var5 = new Float(this.a(var4.a().d()), this.a(var4.a().e()), this.a(var4.b().d()), this.a(var4.b().e()), this.a(var4.c().d()), this.a(var4.c().e()), this.a(var4.d().d()), this.a(var4.d().e()));
            this.i.append(var5, true);
         }
      }

   }

   public void a(za var1) {
      java.awt.geom.Arc2D.Double var2 = new java.awt.geom.Arc2D.Double();
      var2.setArc((double)this.a(var1.d().d()), (double)this.a(var1.d().e()), (double)this.a(var1.e().b()), (double)this.a(var1.e().c()), (double)(-var1.f()), (double)(-var1.g()), 0);
      this.i.append(var2, false);
   }

   public void a(zk var1) {
      if (var1 != null && var1.c != null) {
         com.aspose.cells.b.a.b.zm var2 = zs.a(var1.c);
         if (var2.o() == 0) {
            this.g.setColor(var2.c().d());
         }

         int[] var3 = new int[0];
         int[] var4 = new int[0];
         this.g.setStroke(var2.s());
         double var5 = (double)this.a(var1.a.d());
         double var7 = (double)this.a(var1.a.e());
         double var9 = (double)this.a(var1.b.d());
         double var11 = (double)this.a(var1.b.e());
         java.awt.geom.Line2D.Double var13 = new java.awt.geom.Line2D.Double(var5, var7, var9, var11);
         this.g.draw(var13);
      }

   }

   public void a(zj var1) {
      try {
         switch(var1.e()) {
         case 0:
         case 4:
         case 5:
         case 6:
         case 7:
         case 8:
            byte[] var6 = var1.d();
            if (var6 != null) {
               ByteArrayInputStream var3 = new ByteArrayInputStream(var6);
               BufferedImage var4 = ImageIO.read(var3);
               this.g.drawImage(var4, (int)this.a(var1.b().d()), (int)this.a(var1.b().e()), (int)this.a(var1.b().d() + var1.c().b()), (int)this.a(var1.b().e() + var1.c().c()), 0, 0, var4.getWidth(), var4.getHeight(), (ImageObserver)null);
            }
            break;
         case 1:
         case 2:
            zb var2 = zch.a(var1);
            var2.a((ze)this);
            break;
         case 3:
         default:
            assert false;
         }
      } catch (Exception var5) {
         ;
      }

   }

   private void a(zbg var1) {
      if (zaz.a(var1)) {
         Graphics2D var2 = (Graphics2D)this.g.create();
         this.h.push(this.g);
         this.g = var2;
         if (zaz.c(var1)) {
            AffineTransform var3 = (AffineTransform)var1.a().a().clone();
            double[] var4 = new double[6];
            var3.getMatrix(var4);
            var3.setTransform(var4[0], var4[1], var4[2], var4[3], (double)this.a((float)var4[4]), (double)this.a((float)var4[5]));
            this.g.transform(var3);
         }
      }

   }

   private void b(zbg var1) {
      if (zaz.a(var1)) {
         this.g.dispose();
         this.g = (Graphics2D)((Graphics2D)this.h.pop());
      }

   }

   public GeneralPath c(zn var1) {
      GeneralPath var2 = new GeneralPath();

      for(int var3 = 0; var3 < var1.g().size(); ++var3) {
         zo var4 = (zo)var1.a(var3);
         if (var4.g() != null && var4.g().size() != 0) {
            if (var3 == 0) {
               var2.moveTo(this.a(var4.a().d()), this.a(var4.a().e()));
            }

            for(int var5 = 0; var5 < var4.g().size(); ++var5) {
               zl var6 = var4.a(var5);
               if (var6 instanceof zq) {
                  zq var13 = (zq)var6;

                  for(int var15 = 0; var15 < var13.a().size(); ++var15) {
                     com.aspose.cells.b.a.b.zo var16 = (com.aspose.cells.b.a.b.zo)var13.a().get(var15);
                     var2.lineTo(this.a(var16.d()), this.a(var16.e()));
                  }
               } else if (var6 instanceof zp) {
                  zp var12 = (zp)var6;
                  ArrayList var14 = var12.a();
                  if (var14 != null) {
                     for(int var9 = 0; var9 < var14.size(); ++var9) {
                        zt var10 = (zt)var14.get(var9);
                        Float var11 = new Float(this.a(var10.a().d()), this.a(var10.a().e()), this.a(var10.b().d()), this.a(var10.b().e()), this.a(var10.c().d()), this.a(var10.c().e()), this.a(var10.d().d()), this.a(var10.d().e()));
                        var2.append(var11, true);
                     }
                  }
               } else if (var6 instanceof za) {
                  za var7 = (za)var6;
                  java.awt.geom.Arc2D.Float var8 = new java.awt.geom.Arc2D.Float();
                  var8.setArc((double)this.a(var7.d().d()), (double)this.a(var7.d().e()), (double)this.a(var7.e().b()), (double)this.a(var7.e().c()), (double)this.a(var7.f()), (double)this.a(var7.g()), 0);
                  var2.append(var8, true);
               }
            }

            if (var4.b()) {
               var2.closePath();
            }
         }
      }

      return var2;
   }

   private void a(Graphics2D var1, zn var2) {
      AffineTransform var3 = var2.a() == null ? null : var2.a().a();
      if (var1.getClip() != null) {
         Area var4 = new Area(var1.getClip());
         var4 = var4.createTransformedArea(new AffineTransform());
         GeneralPath var5 = this.c(var2);
         Area var6 = new Area(var5);
         if (var2.a() != null) {
            var6 = var6.createTransformedArea(var3);
         }

         var4.intersect(var6);
         this.g.setClip(var4);
      } else {
         if (var3 != null) {
            this.g.transform(var3);
         }

         this.g.setClip(this.c(var2));
         if (var3 != null) {
            try {
               this.g.transform(var3.createInverse());
            } catch (Exception var7) {
               var7.printStackTrace();
            }
         }
      }

   }

   public float a(float var1, float var2) {
      return (float)zaj.a((double)var1, (double)var2);
   }

   public float a(float var1) {
      return this.a(var1, 96.0F);
   }

   public float b(float var1) {
      return (float)zaj.c((double)var1);
   }

   public int a(int var1) {
      return var1 == 1 ? 1 : 0;
   }

   private void a(Map<Key, Object> var1) {
      if (var1 != null) {
         this.g.addRenderingHints(var1);
      }
   }
}
